home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
ddevb
/
dde_vb.frm
< prev
next >
Wrap
Text File
|
1995-09-06
|
21KB
|
748 lines
VERSION 2.00
Begin Form DDE_VB
BackColor = &H00FFFFFF&
BorderStyle = 3 'Fixed Double
Caption = "DDE_VB"
ClientHeight = 4950
ClientLeft = 1020
ClientTop = 2520
ClientWidth = 7575
Height = 5640
Icon = DDE_VB.FRX:0000
Left = 960
LinkMode = 1 'Source
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 4950
ScaleWidth = 7575
Top = 1890
Width = 7695
Begin TextBox tbStatus
FontBold = -1 'True
FontItalic = -1 'True
FontName = "MS Sans Serif"
FontSize = 8.25
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 360
Left = 0
TabIndex = 14
Top = 4608
Width = 7596
End
Begin CommandButton cmClipboard
Caption = "Clipboard"
Height = 276
Left = 6240
TabIndex = 17
Top = 4128
Width = 1236
End
Begin TextBox tbDDE
Height = 372
Left = 6240
MultiLine = -1 'True
TabIndex = 12
Top = 2208
Visible = 0 'False
Width = 1236
End
Begin TextBox tbText
Height = 2220
Left = 96
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 13
Top = 2208
Width = 6036
End
Begin CommandButton cmPoke
Caption = "Poke"
Height = 276
Left = 6240
TabIndex = 16
Top = 1728
Width = 1236
End
Begin ComboBox cbPoke
Height = 288
Left = 96
TabIndex = 15
Top = 1728
Width = 6036
End
Begin CommandButton cmExecute
Caption = "Execute"
Enabled = 0 'False
Height = 276
Left = 6240
TabIndex = 9
Top = 1344
Width = 1236
End
Begin ComboBox cbExecute
Enabled = 0 'False
Height = 288
Left = 96
TabIndex = 3
Top = 1344
Width = 6036
End
Begin CommandButton cmDisconnect
Caption = "Disconnect"
Height = 276
Left = 6240
TabIndex = 5
Top = 864
Visible = 0 'False
Width = 1236
End
Begin TextBox tbError
ForeColor = &H00000080&
Height = 300
Left = 100
TabIndex = 11
Top = 888
Width = 5676
End
Begin CommandButton cmRequest
Caption = "Request"
Enabled = 0 'False
Height = 276
Left = 6240
TabIndex = 10
Top = 576
Width = 1236
End
Begin ComboBox cbDDE_Item
BackColor = &H00FFFFFF&
Enabled = 0 'False
Height = 288
Left = 3600
TabIndex = 2
Top = 600
Width = 2556
End
Begin ComboBox cbDDE_Topic
BackColor = &H00FFFFFF&
Enabled = 0 'False
Height = 288
Left = 1920
TabIndex = 1
Top = 600
Width = 1572
End
Begin ComboBox cbDDE_App
BackColor = &H00FFFFFF&
Height = 288
Left = 100
TabIndex = 0
Top = 600
Width = 1692
End
Begin CommandButton cmQuit
Caption = "Quit"
Height = 276
Left = 6240
TabIndex = 4
Top = 96
Width = 1236
End
Begin Label txItem
BackColor = &H00FFFFFF&
Caption = "Item"
Height = 255
Left = 3600
TabIndex = 8
Top = 360
Width = 1095
End
Begin Label txTopic
BackColor = &H00FFFFFF&
Caption = "Topic"
Height = 255
Left = 1920
TabIndex = 7
Top = 360
Width = 1095
End
Begin Label txApplication
BackColor = &H00FFFFFF&
Caption = "Application"
Height = 255
Left = 100
TabIndex = 6
Top = 360
Width = 1335
End
Begin Menu mnFile
Caption = "&File"
Begin Menu miFileEdit
Caption = "&Edit INI File"
End
Begin Menu miFileExit
Caption = "E&xit"
End
End
Begin Menu mnSave
Caption = "&Save"
Index = 0
Begin Menu miSaveApp
Caption = "&Application"
End
Begin Menu miSaveTopic
Caption = "&Topic"
End
Begin Menu miSaveItem
Caption = "&Item"
End
Begin Menu miBar1
Caption = "-"
End
Begin Menu miSaveExecute
Caption = "&Execute"
End
Begin Menu miBar2
Caption = "-"
End
Begin Menu miSavePoke
Caption = "&Poke"
End
End
Begin Menu mnHelp
Caption = "&Help"
Begin Menu miHelpAbout
Caption = "&About"
End
End
End
DefInt A-X
Const NO_APP = 282
Const MULTIPLE_APPS = 283
Const WRONG_DATA_TYPE = 285
Const WM_USER = &H400
Const LB_RESETCONTENT = WM_USER + 5
Const CB_RESETCONTENT = WM_USER + 11
Dim DDEApp As String
Dim DDETopic As String
Dim DDEItem As String
Dim ValidLink As Integer
Dim app As String * 100
Dim exec As String * 200
Dim item As String * 100
Dim Topic As String * 100
Dim clipname As String * 40
Const INIFILE$ = "DDE_VB.INI"
Const INI_APPS$ = "Applications"
Dim HelpFilePath$
Dim CR$
Dim LF$
Dim NL$
Dim TB$
Sub cbDDE_App_Change ()
cbDDE_Topic.Enabled = True
cbDDE_Topic.text = ""
cbDDE_Item.Enabled = False
cbDDE_Item.text = ""
cmDisconnect_click
End Sub
Sub cbDDE_App_DropDown ()
ClearComboBox cbDDE_App
Count% = GetPrivateProfileInt("Applications", "Apps", 0, INIFILE$)
ReDim arIniApps(Count%)
For i% = 1 To Count%
zBuff% = GetPrivateProfileString("Applications", "App" + LTrim$(Str$(i%)), "none", app, 255, INIFILE$)
arIniApps(i% - 1).AppName = LTrim$(RTrim$(Left$(app, zBuff%)))
cbDDE_App.AddItem arIniApps(i% - 1).AppName
Next
cbDDE_Topic.Enabled = True
cbDDE_Topic.text = ""
cbDDE_Item.Enabled = False
cbDDE_Item.text = ""
End Sub
Sub cbDDE_App_GotFocus ()
tbStatus.text = "Select / Enter Application name to connect to..."
End Sub
Sub cbDDE_App_LostFocus ()
tbStatus.text = ""
End Sub
Sub cbDDE_Item_DropDown ()
ClearComboBox cbDDE_Item
cmRequest.Enabled = True
Topic = cbDDE_Topic.text
Count2% = GetPrivateProfileInt(app, "Items", 0, INIFILE$)
ReDim arItems(Count2%)
For ii% = 1 To Count2%
zBuff% = GetPrivateProfileString(app, "Item" + LTrim$(Str$(ii%)), "none", item, 255, INIFILE$)
arItems(ii% - 1).item = LTrim$(RTrim$(Left$(item, z